<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantumLibrary: /bb/mbigc/mbig5696/git/quantum_external/src/interface/quantum_ithread_context.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QuantumLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d3/d38/quantum__ithread__context_8h_source.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">quantum_ithread_context.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">** Copyright 2018 Bloomberg Finance L.P.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">** Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">** you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">** You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">**     http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">** Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">** distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">** See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">** limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef BLOOMBERG_QUANTUM_ITHREAD_CONTEXT_H</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define BLOOMBERG_QUANTUM_ITHREAD_CONTEXT_H</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;future&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;chrono&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_traits.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;quantum/interface/quantum_ithread_context_base.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">namespace </span><a class="code" href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a> {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span>quantum {</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> RET&gt;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keyword">class </span>Context;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">//                                      interface IThreadContext</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> RET&gt;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html">   37</a></span>&#160;<span class="keyword">struct </span><a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html">IThreadContext</a> : <span class="keyword">public</span> <a class="code" href="../../da/d4d/structBloomberg_1_1quantum_1_1IThreadContextBase.html">IThreadContextBase</a></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;{</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ac70ef12cc80708a891d3ca1090adff2e">   39</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../de/de9/structBloomberg_1_1quantum_1_1ThreadContextTag.html">ContextTag</a> = <a class="code" href="../../de/de9/structBloomberg_1_1quantum_1_1ThreadContextTag.html">ThreadContextTag</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">   40</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#ac92e5d294479f777fd01f5621e4f8db9">Ptr</a> = std::shared_ptr&lt;IThreadContext&lt;RET&gt;&gt;;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ab3c1dd50a3abd82d5d881eeda65e32e5">   41</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html">Impl</a> = <a class="code" href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html">Context&lt;RET&gt;</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    </div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a61b2eb7438e46915e411d3fd7e96b82d">wait</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    </div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">virtual</span> std::future_status <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0bb2b08d8b6688e2186aaf3afb394dae">waitFor</a>(std::chrono::milliseconds timeMs) <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    </div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ac31560ef1209af2c86a76260dd70b189">waitAt</a>(<span class="keywordtype">int</span> num) <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    </div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keyword">virtual</span> std::future_status <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a6488bdb8b5c270ebaa069d7d9ed5819a">waitForAt</a>(<span class="keywordtype">int</span> num, std::chrono::milliseconds timeMs) <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a4724f410e1d41c185f46ad394ad3bbe2">waitAll</a>() <span class="keyword">const</span> = 0;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    </div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V = RET&gt;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a0a7dd2b5f475bbecb11bfa87fcc251c5">NonBufferRetType&lt;V&gt;</a> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a8c969eafd7cdd1b694c33194a9dd7c09">get</a>();</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V = RET&gt;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a0a7dd2b5f475bbecb11bfa87fcc251c5">NonBufferRetType&lt;V&gt;</a>&amp; <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a2eed7d5de4d43b5c5c214cb38b239acd">getRef</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    </div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> OTHER_RET&gt;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a0a7dd2b5f475bbecb11bfa87fcc251c5">NonBufferRetType&lt;OTHER_RET&gt;</a> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a8d04a093d07bf66ead58603592295352">getAt</a>(<span class="keywordtype">int</span> num);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    </div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> OTHER_RET&gt;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    <span class="keyword">const</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a0a7dd2b5f475bbecb11bfa87fcc251c5">NonBufferRetType&lt;OTHER_RET&gt;</a>&amp; <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a5456b3de0627bee9695946acf745e195">getRefAt</a>(<span class="keywordtype">int</span> num) <span class="keyword">const</span>;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    </div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V, <span class="keyword">class</span> = NonBufferType&lt;RET,V&gt;&gt;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a5612c3e719e8fe2104ada21a10767b4a">set</a>(V&amp;&amp; value);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    </div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V, <span class="keyword">class</span> = BufferType&lt;RET,V&gt;&gt;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ab6e481262f106b0ed5fd5c0b86978c03">push</a>(V&amp;&amp; value);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    </div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V = RET&gt;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a3e3f89ff8206c0514976b423cb7199cd">BufferRetType&lt;V&gt;</a> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a65ced94956cdfff4ad094897b14f8234">pull</a>(<span class="keywordtype">bool</span>&amp; isBufferClosed);</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    </div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> V = RET, <span class="keyword">class</span> = BufferRetType&lt;V&gt;&gt;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aef2bff661268949c9c598e0674ff7254">closeBuffer</a>();</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    </div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a974f72467140b4d4047d8b76d2011703">getNumCoroutineThreads</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    </div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aaf40c9f4c874571d103a2b40c2dbf554">getNumIoThreads</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keyword">const</span> std::pair&lt;int, int&gt;&amp; <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a42ea867e65bc7e31a4373dc2142cef75">getCoroQueueIdRangeForAny</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    </div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="comment">//=========================================================================================</span></div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="comment">//                                      TASK CONTINUATIONS</span></div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="comment">//=========================================================================================</span></div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="comment"></span>    <span class="comment">//-----------------------------------------------------------------------------------------</span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    </div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>OTHER_RET = int, <span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keyword">typename</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">IThreadContext&lt;OTHER_RET&gt;::Ptr</a></div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a7a6bbcc70d8d886864351513680ede87">then</a>(FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    </div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>OTHER_RET = int, <span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="keyword">typename</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">IThreadContext&lt;OTHER_RET&gt;::Ptr</a></div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aa911856faa7b71962984a101cfb59cf0">onError</a>(FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    </div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class </span>OTHER_RET = int, <span class="keyword">class </span>FUNC, <span class="keyword">class </span>... ARGS&gt;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keyword">typename</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">IThreadContext&lt;OTHER_RET&gt;::Ptr</a></div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <span class="keywordflow">finally</span>(FUNC&amp;&amp; func, ARGS&amp;&amp;... args);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    </div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <a class="code" href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#ac92e5d294479f777fd01f5621e4f8db9">Ptr</a> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a3a0a83b7941b8b0cf2c0a9ce6ec0f7ab">end</a>();</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;};</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> RET&gt;</div><div class="line"><a name="l00239"></a><span class="lineno"><a class="line" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#aa9da8335ae6292074d0ccaf31b85bf35">  239</a></span>&#160;<span class="keyword">using</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html">ThreadContext</a> = <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html">IThreadContext&lt;RET&gt;</a>;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> RET&gt;</div><div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#aa26dcdfb6c3930c1cd2b4000d8711f4c">  242</a></span>&#160;<span class="keyword">using</span> <a class="code" href="../../dc/d48/namespaceBloomberg_1_1quantum.html#aa26dcdfb6c3930c1cd2b4000d8711f4c">ThreadContextPtr</a> = <span class="keyword">typename</span> <a class="code" href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">IThreadContext&lt;RET&gt;::Ptr</a>;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;}}</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="preprocessor">#endif //BLOOMBERG_QUANTUM_ITHREAD_CONTEXT_H</span></div><div class="ttc" id="namespaceBloomberg_html"><div class="ttname"><a href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a></div><div class="ttdef"><b>Definition:</b> quantum_buffer_impl.h:22</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_aaf40c9f4c874571d103a2b40c2dbf554"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aaf40c9f4c874571d103a2b40c2dbf554">Bloomberg::quantum::IThreadContext::getNumIoThreads</a></div><div class="ttdeci">int getNumIoThreads() const</div><div class="ttdoc">Returns the number of underlying IO threads as specified in the dispatcher constructor.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:92</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IContextBase_html_ac92e5d294479f777fd01f5621e4f8db9"><div class="ttname"><a href="../../d8/db0/structBloomberg_1_1quantum_1_1IContextBase.html#ac92e5d294479f777fd01f5621e4f8db9">Bloomberg::quantum::IContextBase::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; IContextBase &gt; Ptr</div><div class="ttdef"><b>Definition:</b> quantum_icontext_base.h:35</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a0bb2b08d8b6688e2186aaf3afb394dae"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0bb2b08d8b6688e2186aaf3afb394dae">Bloomberg::quantum::IThreadContext::waitFor</a></div><div class="ttdeci">virtual std::future_status waitFor(std::chrono::milliseconds timeMs) const =0</div><div class="ttdoc">Waits for the future associated with this context to be ready for a maximum of 'timeMs' milliseconds.</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a4724f410e1d41c185f46ad394ad3bbe2"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a4724f410e1d41c185f46ad394ad3bbe2">Bloomberg::quantum::IThreadContext::waitAll</a></div><div class="ttdeci">virtual void waitAll() const =0</div><div class="ttdoc">Wait for all the futures in the continuation chain to be ready.</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a6488bdb8b5c270ebaa069d7d9ed5819a"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a6488bdb8b5c270ebaa069d7d9ed5819a">Bloomberg::quantum::IThreadContext::waitForAt</a></div><div class="ttdeci">virtual std::future_status waitForAt(int num, std::chrono::milliseconds timeMs) const =0</div><div class="ttdoc">Waits for the future in the 'num-th' continuation context to be ready for a maximum of 'timeMs' milli...</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a5456b3de0627bee9695946acf745e195"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a5456b3de0627bee9695946acf745e195">Bloomberg::quantum::IThreadContext::getRefAt</a></div><div class="ttdeci">const NonBufferRetType&lt; OTHER_RET &gt; &amp; getRefAt(int num) const</div><div class="ttdoc">Get a reference to the future value from the 'num-th' continuation context.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:52</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a2eed7d5de4d43b5c5c214cb38b239acd"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a2eed7d5de4d43b5c5c214cb38b239acd">Bloomberg::quantum::IThreadContext::getRef</a></div><div class="ttdeci">const NonBufferRetType&lt; V &gt; &amp; getRef() const</div><div class="ttdoc">Get a reference the future value associated with this context.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:38</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a0b7724a925c43a5a9661e90f7f331651"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a0b7724a925c43a5a9661e90f7f331651">Bloomberg::quantum::IThreadContext::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; IThreadContext&lt; RET &gt; &gt; Ptr</div><div class="ttdef"><b>Definition:</b> quantum_ithread_context.h:40</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContextBase_html"><div class="ttname"><a href="../../da/d4d/structBloomberg_1_1quantum_1_1IThreadContextBase.html">Bloomberg::quantum::IThreadContextBase</a></div><div class="ttdoc">Exposes methods to manipulate the thread context, especially future wait methods.</div><div class="ttdef"><b>Definition:</b> quantum_ithread_context_base.h:34</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_aef2bff661268949c9c598e0674ff7254"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aef2bff661268949c9c598e0674ff7254">Bloomberg::quantum::IThreadContext::closeBuffer</a></div><div class="ttdeci">int closeBuffer()</div><div class="ttdoc">Close a promise buffer.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:80</div></div>
<div class="ttc" id="namespaceBloomberg_1_1quantum_html_a0a7dd2b5f475bbecb11bfa87fcc251c5"><div class="ttname"><a href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a0a7dd2b5f475bbecb11bfa87fcc251c5">Bloomberg::quantum::NonBufferRetType</a></div><div class="ttdeci">std::enable_if_t&lt;!Traits::IsBuffer&lt; T &gt;::value, typename Traits::IsBuffer&lt; T &gt;::Type &gt; NonBufferRetType</div><div class="ttdef"><b>Definition:</b> quantum_traits.h:95</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a42ea867e65bc7e31a4373dc2142cef75"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a42ea867e65bc7e31a4373dc2142cef75">Bloomberg::quantum::IThreadContext::getCoroQueueIdRangeForAny</a></div><div class="ttdeci">const std::pair&lt; int, int &gt; &amp; getCoroQueueIdRangeForAny() const</div><div class="ttdoc">Gets the range [minQueueId, maxQueueId] of coroutine queueIds covered by IQueue::QueueId::Any by the ...</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:98</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_ac31560ef1209af2c86a76260dd70b189"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ac31560ef1209af2c86a76260dd70b189">Bloomberg::quantum::IThreadContext::waitAt</a></div><div class="ttdeci">virtual void waitAt(int num) const =0</div><div class="ttdoc">Waits for the future in the 'num-th' continuation context to be ready.</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Context_html"><div class="ttname"><a href="../../d8/df7/classBloomberg_1_1quantum_1_1Context.html">Bloomberg::quantum::Context</a></div><div class="ttdoc">Concrete class representing a coroutine or a thread context.</div><div class="ttdef"><b>Definition:</b> quantum_icoro_context.h:29</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a8c969eafd7cdd1b694c33194a9dd7c09"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a8c969eafd7cdd1b694c33194a9dd7c09">Bloomberg::quantum::IThreadContext::get</a></div><div class="ttdeci">NonBufferRetType&lt; V &gt; get()</div><div class="ttdoc">Get the future value associated with this context.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:31</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a7a6bbcc70d8d886864351513680ede87"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a7a6bbcc70d8d886864351513680ede87">Bloomberg::quantum::IThreadContext::then</a></div><div class="ttdeci">IThreadContext&lt; OTHER_RET &gt;::Ptr then(FUNC &amp;&amp;func, ARGS &amp;&amp;... args)</div><div class="ttdoc">Posts a function to run asynchronously.</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a61b2eb7438e46915e411d3fd7e96b82d"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a61b2eb7438e46915e411d3fd7e96b82d">Bloomberg::quantum::IThreadContext::wait</a></div><div class="ttdeci">virtual void wait() const =0</div><div class="ttdoc">Waits for the future associated with this context to be ready.</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1ThreadContextTag_html"><div class="ttname"><a href="../../de/de9/structBloomberg_1_1quantum_1_1ThreadContextTag.html">Bloomberg::quantum::ThreadContextTag</a></div><div class="ttdef"><b>Definition:</b> quantum_icontext_base.h:26</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_ab6e481262f106b0ed5fd5c0b86978c03"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#ab6e481262f106b0ed5fd5c0b86978c03">Bloomberg::quantum::IThreadContext::push</a></div><div class="ttdeci">void push(V &amp;&amp;value)</div><div class="ttdoc">Push a single value into the promise buffer.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:66</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a8d04a093d07bf66ead58603592295352"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a8d04a093d07bf66ead58603592295352">Bloomberg::quantum::IThreadContext::getAt</a></div><div class="ttdeci">NonBufferRetType&lt; OTHER_RET &gt; getAt(int num)</div><div class="ttdoc">Get the future value from the 'num-th' continuation context.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:45</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a5612c3e719e8fe2104ada21a10767b4a"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a5612c3e719e8fe2104ada21a10767b4a">Bloomberg::quantum::IThreadContext::set</a></div><div class="ttdeci">int set(V &amp;&amp;value)</div><div class="ttdoc">Set the promised value associated with this context.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:59</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_aa911856faa7b71962984a101cfb59cf0"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#aa911856faa7b71962984a101cfb59cf0">Bloomberg::quantum::IThreadContext::onError</a></div><div class="ttdeci">IThreadContext&lt; OTHER_RET &gt;::Ptr onError(FUNC &amp;&amp;func, ARGS &amp;&amp;... args)</div><div class="ttdoc">Posts a function to run asynchronously. This is the error handler for a continuation chain and acts a...</div></div>
<div class="ttc" id="namespaceBloomberg_1_1quantum_html_a3e3f89ff8206c0514976b423cb7199cd"><div class="ttname"><a href="../../dc/d48/namespaceBloomberg_1_1quantum.html#a3e3f89ff8206c0514976b423cb7199cd">Bloomberg::quantum::BufferRetType</a></div><div class="ttdeci">std::enable_if_t&lt; Traits::IsBuffer&lt; T &gt;::value, typename Traits::IsBuffer&lt; T &gt;::Type &gt; BufferRetType</div><div class="ttdef"><b>Definition:</b> quantum_traits.h:93</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html">Bloomberg::quantum::IThreadContext</a></div><div class="ttdoc">Exposes methods to manipulate the thread context.</div><div class="ttdef"><b>Definition:</b> quantum_ithread_context.h:37</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a3a0a83b7941b8b0cf2c0a9ce6ec0f7ab"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a3a0a83b7941b8b0cf2c0a9ce6ec0f7ab">Bloomberg::quantum::IThreadContext::end</a></div><div class="ttdeci">Ptr end()</div><div class="ttdoc">This is the last method in a continuation chain.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:129</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a974f72467140b4d4047d8b76d2011703"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a974f72467140b4d4047d8b76d2011703">Bloomberg::quantum::IThreadContext::getNumCoroutineThreads</a></div><div class="ttdeci">int getNumCoroutineThreads() const</div><div class="ttdoc">Returns the number of underlying coroutine threads as specified in the dispatcher constructor....</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:86</div></div>
<div class="ttc" id="namespaceBloomberg_1_1quantum_html_aa26dcdfb6c3930c1cd2b4000d8711f4c"><div class="ttname"><a href="../../dc/d48/namespaceBloomberg_1_1quantum.html#aa26dcdfb6c3930c1cd2b4000d8711f4c">Bloomberg::quantum::ThreadContextPtr</a></div><div class="ttdeci">typename IThreadContext&lt; RET &gt;::Ptr ThreadContextPtr</div><div class="ttdef"><b>Definition:</b> quantum_ithread_context.h:242</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IThreadContext_html_a65ced94956cdfff4ad094897b14f8234"><div class="ttname"><a href="../../da/de3/structBloomberg_1_1quantum_1_1IThreadContext.html#a65ced94956cdfff4ad094897b14f8234">Bloomberg::quantum::IThreadContext::pull</a></div><div class="ttdeci">BufferRetType&lt; V &gt; pull(bool &amp;isBufferClosed)</div><div class="ttdoc">Pull a single value from the future buffer.</div><div class="ttdef"><b>Definition:</b> quantum_context_impl.h:73</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="../../dir_650ee533936399e683a30afb9473a469.html">interface</a></li><li class="navelem"><b>quantum_ithread_context.h</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
